<html>
<head><meta charset="utf-8"><title>async vision: embedded · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html">async vision: embedded</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228507865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228507865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228507865">(Mar 02 2021 at 23:45)</a>:</h4>
<p>I'm curious to find someone who wants to own the "status quo" experience for embedded developers. I'm hoping to draft <span class="user-mention" data-user-id="348152">@Dario Nieuwenhuis</span>, <span class="user-mention" data-user-id="228912">@James Munns</span>, or maybe <span class="user-mention" data-user-id="392749">@Daniel Egger</span> into this =)</p>



<a name="228514163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228514163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228514163">(Mar 03 2021 at 00:41)</a>:</h4>
<p>I'm only innocent bystander at the moment, time is really flying by... All I can say is that we're seeing two very important topics re async and embedded: runtime/executor/scheduler (we don't have threads but interrupts and increasingly also multi-core which are real and only partially solved challenges) and interfaces/APIs (in embedded we have blocking and "non-blocking" traits which allow us write generic drivers which work with any chips implementing drivers following those "embedded-hal" interfaces). embedded-hal works but on a rather pedestrian and not really async compatible niveau.</p>



<a name="228516018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228516018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228516018">(Mar 03 2021 at 01:01)</a>:</h4>
<p><span class="user-mention" data-user-id="392749">@Daniel Egger</span> I'm confused a bit -- don't have threads, but do have multicore?</p>



<a name="228516048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228516048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228516048">(Mar 03 2021 at 01:01)</a>:</h4>
<p>any pointers to the nonblocking traits?</p>



<a name="228516124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228516124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228516124">(Mar 03 2021 at 01:02)</a>:</h4>
<p>I guess probably the status quo for embedded devs on async is kind of "just can't do it"?</p>



<a name="228517399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228517399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228517399">(Mar 03 2021 at 01:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/async.20vision/near/228516018">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="392749">Daniel Egger</span> I'm confused a bit -- don't have threads, but do have multicore?</p>
</blockquote>
<p>Well, threads are (for most CPUs) only a software abstraction which we don't have in embedded.</p>



<a name="228517597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228517597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228517597">(Mar 03 2021 at 01:16)</a>:</h4>
<p><a href="https://docs.rs/embedded-hal/0.2.4/embedded_hal/index.html">https://docs.rs/embedded-hal/0.2.4/embedded_hal/index.html</a></p>



<a name="228517660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228517660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228517660">(Mar 03 2021 at 01:17)</a>:</h4>
<p>It also shows some very outdated ideas about how futures could possibly come into play.</p>



<a name="228517819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228517819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228517819">(Mar 03 2021 at 01:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/async.20vision/near/228516124">said</a>:</p>
<blockquote>
<p>I guess probably the status quo for embedded devs on async is kind of "just can't do it"?</p>
</blockquote>
<p>Yes, not in a useful, standardised and efficient manner. And definitely not on stable (though 1.51 will get us yet another step closer).</p>



<a name="228520019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228520019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228520019">(Mar 03 2021 at 01:41)</a>:</h4>
<p>Multi-core in Rust is a sad topic. Rust doesn't quite provide the low-level concepts to deal with those really. Basically you have independent cores (sometimes even different architectures, like ARMv6M ARMv7EM) and sharing some resources resources (RAM, FLASH, memory mapped IO, interrupts) which run in parallel and without hardware arbiter. Often there's an implementation specific hardware peripheral (mailbox, semaphore or fifos) which can be used to exchange data and steer code execution between the cores but other than that the application runing on those chips is supposed to bootstrap the cores and steer execution somehow. We don't have a good story on how we could possibly deal with that in Rust yet; this either requires some sort of OS to be bundled with all bare metal applications or the (partial)  implementation of libstd for specific chips. An async executor alone will probably not get us close enough.</p>



<a name="228562627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228562627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228562627">(Mar 03 2021 at 09:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="392749">Daniel Egger</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/async.20vision/near/228517399">said</a>:</p>
<blockquote>
<p>Well, threads are (for most CPUs) only a software abstraction which we don't have in embedded.</p>
</blockquote>
<p>side note: ime people use embedded to mean everything from Raspberry Pi to RTOS or whatever. Are there "finer-grained" terms people use?</p>



<a name="228562682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228562682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228562682">(Mar 03 2021 at 09:41)</a>:</h4>
<p>(also, I broke this out into its own topic)</p>



<a name="228589636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228589636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228589636">(Mar 03 2021 at 13:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded/near/228562627">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="392749">Daniel Egger</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/async.20vision/near/228517399">said</a>:</p>
<blockquote>
<p>Well, threads are (for most CPUs) only a software abstraction which we don't have in embedded.</p>
</blockquote>
<p>side note: ime people use embedded to mean everything from Raspberry Pi to RTOS or whatever. Are there "finer-grained" terms people use?</p>
</blockquote>
<p>Nope, you're spot on that people are calling a whole bunch of different things "embedded". My personsal definition is something like: Any system which has a programmable processor and is not capable of running a general purpose operating system.</p>



<a name="228589800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228589800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228589800">(Mar 03 2021 at 13:24)</a>:</h4>
<p>Careful with Raspberry Pi because they're now also doing embedded systems... ;)  <a href="https://www.raspberrypi.org/blog/raspberry-pi-pico-vertical-innovation/">https://www.raspberrypi.org/blog/raspberry-pi-pico-vertical-innovation/</a></p>



<a name="228600852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228600852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alice Ryhl <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228600852">(Mar 03 2021 at 14:31)</a>:</h4>
<p>I mean, there are definitely people who are calling what they are doing embedded even if they have an OS on their device. E.g. I know a company that develops Rust software that they run on repurposed wifi routers, and they call this embedded too even though it runs Linux.</p>



<a name="228617786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/async%20vision%3A%20embedded/near/228617786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Egger <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/async.20vision.3A.20embedded.html#228617786">(Mar 03 2021 at 16:05)</a>:</h4>
<p>Yeah. The embedded WG also caters for Linux based Raspberry Pi developers due to the possibility of doing embedded development on a Raspberry Pi. The available peripherals allow you to connect all kinds of accessories you'd use in much more constrained systems and develop drivers and other things much more comfortably. But that's stretching "embedded" quite a bit...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>